1. Field of the Invention
The present invention relates to a data split parallel shifter for splitting data in connection with a processing of a microprocessor and then executing a shifting operation. Further, the present invention relates to an adder/subtractor and, more particularly, an adder/subtractor employed in a processor for supporting mainly multimedia functions, etc.
2. Description of the Prior Art
In a processor module of a processor for executing data processing, as an approach for improving a data processing efficiency, there is a processing system in which data are split into a plurality of fields and then data in respective fields are processed in bulk. For example, 64-bit data is split into four 16-bit data and then four adding operations are executed at the same time according to an add command.                     A        ⁡                  [                      63            ⁢                          :                        ⁢            48                    ]                                    A        ⁡                  [                      47            ⁢                          :                        ⁢            32                    ]                                    A        ⁡                  [                      31            ⁢                          :                        ⁢            16                    ]                                    A        ⁡                  [                      15            ⁢                          :                        ⁢            0                    ]                                +              +              +              +                          B        ⁡                  [                      63            ⁢                          :                        ⁢            48                    ]                                    B        ⁡                  [                      47            ⁢                          :                        ⁢            32                    ]                                    B        ⁡                  [                      31            ⁢                          :                        ⁢            16                    ]                                    B        ⁡                  [                      15            ⁢                          :                        ⁢            0                    ]                                =              =              =              =                          C        ⁡                  [                      63            ⁢                          :                        ⁢            48                    ]                                    C        ⁡                  [                      47            ⁢                          :                        ⁢            32                    ]                                    C        ⁡                  [                      31            ⁢                          :                        ⁢            16                    ]                                    C        ⁡                  [                      15            ⁢                          :                        ⁢            0                    ]                    
This processing system can show its performance in the fields such as image processing, speech processing, etc. rather than existing scientific and technical computation, business processing computation, etc. These processings need a shifting process in addition to the arithmetic operations and the logical operation. Normally, as the shifting process, there are the logical shift in which 0 is filled in vacant locations caused by shift, and the arithmetic shift which executes the code extension. In order to enable the shifting process after the data is split into a plurality of fields, a switching process indicating which portion of the fields should be code-extended in conformity with split mode is requested. For example, the results derived when a 3-bit rightward arithmetic shift is applied to 32-Bit data in a 32 bit mode, a 16 bitxc3x972 mode, and an 8 bitxc3x974 mode respectively are given in the following.
Out of the above data, underlined portions are code extension portions. That is, the code extension is applied to the bit 31 in the 32-bit shift mode. In the 16 bitxc3x972 mode, the code extension is applied to the bit 31 in upper 16 bits, while the code extension is applied to the bit 15 in lower 16 bits. In the 8 bitxc3x974 mode, the bit 31 is extended in the bit range from the bit 31 to the bit 24, the bit 23 is extended in the bit range from the bit 23 to the bit 16, the bit 15 is extended in the bit range from the bit 15 to the bit 8, and the bit 7 is extended in the bit range from the bit 7 to the bit 0. In the logical shift, the above underlined portions are extended into 0.
Next, a configuration of the shifter will be explained hereunder. For clarification of explanation, the rightward shifting process will be explained.
To begin with, the normal shifter without a split function will be explained. A normal 32-bit rightward shifter is shown in FIG. 1. In FIG. 1, in the 32-bit shifter, bit shifters 101 to 105 for shifting the data by 1 bit, 2 bit, 4 bit, 8 bit, and 16 bit respectively are connected in a multistage fashion. Such bit shifters are constructed by a simple selector respectively. The 32-bit shifter is constructed by stacking these selectors in a multistage fashion. The 1-bit shifter 101 outputs data, which is located at the bit adjacent to the corresponding bit on the left side by one bit, out of the data supplied from the 2-bit shifter 102 when the shifting is executed, while the 1-bit shifter 101 outputs data located at the corresponding bit as it is when the shifting is not executed. A select signal indicating whether adjacent data should be output or the data should be output as it is can be generated based on the least significant bit of the signal indicating an amount of shift and the signal indicating the leftward/rightward shifting direction. More particularly, the 1-bit shifting is executed if 1 is set at the least significant bit, while the 1-bit shifting is not needed if 0 is set at the least significant bit and thus the data is output downward as it is. In the 2-bit shifter 102, either the data located on the left side by two bits in relation to the corresponding bit should be output or the data located at the corresponding bit should be output as it is can be selected. The select signal for the 2-bit shifter 102 is a value on the second least significant bit in the signal indicating the amount of shift. Depending upon that which shifters are to be operated in compliance with the amount-of-shift signal respectively, the shifting operation to achieve any amount of shift ranging from the 0 bit to 31 bit can be carried out. For instance, in the case of the 3-bit shifting, shift of the data is effected by the 1-bit shifter 101 and 2-bit shifter 102, nevertheless no shift of the data is effected by other shifters 103, 104, 105.
Unless the data is split into the fields, the code extension process can be implemented by extending either the leftmost value of the original data, if the arithmetic shift is applied, or 0, if the logical shift is applied, by the bit number equal to the amount of shift from the most significant bit in respective shifters.
The data used in code extension consists of a control signal indicating which one of the arithmetic shift and the logical shift should be executed and actual code extension data, and such data can be generated previously in a code extension data generator. For example, there is no lefthand data to be fetched for the leftmost selector in the 1-bit shifter 101. However, if the code extension data supplied from the code extension data generator is inserted into the port, such leftmost selector can output the code extension data when one-bit shift is generated.
As shown in FIG. 2, the code extension data generator is constructed to comprise multiplexers 106 to 108 and logic gates 109 to 112, for example. In the arithmetic shift in which an arithmetic shift signal is at a high level, according to such configuration, the bit 31 of the original data is output as the code extension data for all 32 bits in the 32-bit shift mode. Then, in the 16 bitxc3x972 mode, the bit 31 of the original data is output in the bit range of the upper bits 31 to 16 while the bit 15 of the original data is output in the bit range of the lower bits 15 to 0. Then, in the 8 bitxc3x974 mode, the bit 31 of the original data is output in the bit range of the bits 31 to 24, the bit 23 of the original data is output in the bit range of the bits 23 to 16, the bit 15 of the original data is output in the bit range of the bits 15 to 8, and the bit 7 of the original data is output in the bit range of the bits 7 to 0. On the contrary, in the logical shift in which the arithmetic shift signal is at a low level, 0 is output to all bits as the code extension data.
In the event that the 16 bitxc3x972 mode and the 8 bitxc3x974 mode, described above, are added to the shifter shown in FIG. 1, it becomes an issue how the above code extension process should be carried out. As shown in FIG. 3, in order to add the code extension function, code extension selectors 113 for selecting either the code extension or the normal shift can be inserted between respective stages of the shifters 101 to 105 respectively.
In the 16 bitxc3x972 mode, the 16-bit shifter 105 controls all code extension selectors 113 to select the code extension. In the 8-bit shifter 104, the code extension selector 113 controls to select the code extension for the bits 15 to 8. Similarly, the 4-bit shifter 103 controls to select the code extension for the bits 15 to 12, the 2-bit shifter 102 controls to select the code extension for the bits 15 to 14, and the 1-bit shifter 101 controls to select the code extension for the bit 15.
In the 8 bitxc3x974 mode, the 16-bit shifter 105 and the 8-bit shifter 104 controls all code extension selectors 113 to select the code extension. The 4-bit shifter 103 controls the code extension selectors 113 to select the code extension data for the bits 23 to 20, the bits 15 to 12, the bits 7 to 4. The 2-bit shifter 102 controls the code extension selectors 113 to select the code extension data for the bits 23 to 22, the bits 15 to 14, the bits 7 to 6. The 1-bit shifter 101 controls the code extension selectors 113 to select the code extension data for the bit 23, the bit 15, the bit 7.
In this way, if the code extension selectors 113 are inserted between the bit shifters respectively, the data can be split into a plurality of fields to achieve parallel shift. However, since such code extension selectors 113 are implemented by the selector which is the same in structure as the shifter, the circuit has twice the stage number of the normal shifter and thus a processing speed becomes very slow. In addition, the case where the code extension data generators are provided has been explained, but a delay time caused to generate the code extension data by the circuit is added to an entire delay time as it is in this case. As a method wherein the code extension data generator is not employed, the selector for selecting which data should be employed as the code extension data according to respective modes may be added to respective code extension selectors 113. In this case, increases in the delay of speed and the circuit scale are caused beyond the case where the code extension data generators are employed.
In the normal shifter, the data must be passed through five stages of the selectors for 32-bit shift. In order to improve the processing speed, such a circuit may be incorporated in place of the above that the process corresponding to those at two stages can be carried out at a time by employing the 4-input selector with a combined selecting function instead of the 2-input selector. For example, 1-bit shift and 2-bit shift are employed as inputs of the selector at one stage to enable selection of 3-bit leftward shift, 1-bit leftward shift, or no shift. However, if parallel shift function is added to such circuit, a circuit configuration of the shifter becomes complicated since the code extension selectors are increased three times every bit. In addition, in the barrel shifter which can effect both the leftward shift and the rightward shift, the code extension selectors are also increased two times and therefore a circuit configuration of the shifter becomes further difficult in respects of area and speed.
As described above, in the data split parallel shifter in the prior art in which split data are shifted in parallel respectively, if the code extension process is to be effected, such data split parallel shifter needs twice the selectors as many as the normal shifter without the code extension function, which yields increase in size and reduction in the processing speed. Further, since a time required for generating extension codes previously is added to the entire operating time of the shifter, the processing speed is lowered much more.
Next, the adder/subtractor in the prior art will be explained.
As the adder/subtractor in the prior art, there is a carry-select type adder/subtractor. The carry-select type is employed to accelerate the processing speed. More particularly, two adders each has respectively one of two way carries which are to be output from the lower bit adder as its constant respectively are prepared to obtain two way added results previously in upper bit calculation without waiting the carry from the lower bit adder, so that one of two way added results can be selected in the upper bit calculation based on the carry from the lower bit adder.
The carry-select type adder/subtractor in the prior art comprises a lower 16-bit adder, two adders for effecting upper 16-bit addition, and a carry/SUM selector for selecting one of added results from the two adders according to the carry supplied from the lower 16-bit adder to output it.
Besides, there is a technique to add a parallel processing function to such carry-select type adder/subtractor. FIG. 4 is a view showing the carry-select type adder/subtractor with the parallel processing function in the prior art. In the carry-select type adder/subtractor having the parallel processing function in the prior art shown in FIG. 4, a carry controller 117 is added to the carry-select type adder/subtractor in the prior art which comprises a lower 16-bit adder 111, two 16-bit adders 113, 115 for effecting the upper 16-bit addition, and a carry/SUM selector 119 as its constituent elements.
In the carry-select type adder/subtractor with the parallel processing function in the prior art, in case the 32-bit addition/subtraction is effected, the carry controller 117 sends the carry supplied from the lower 16-bit adder 111 to the carry/SUM selector 119 as it is. In case the 16-bit parallel addition/subtraction is effected, the carry controller 117 always sends the information indicating no carry (e.g., xe2x80x9c0xe2x80x9d) to the carry/SUM selector 119 regardless of the carry supplied from the lower 16-bit adder 111. Therefore, the carry/SUM selector 119 can always select the output data from the upper 16-bit adder which outputs the added result for the case where no carry is supplied from the lower digits. As a result, the 16-bit parallel addition/subtraction can be accomplished.
However, in the case of the adder/subtractor in the prior art, since the controller is added to the upper bit adder and the lower bit adder, additional delay is caused in such added controller when the adder/subtractor is used as one adder circuit. This delay becomes remarkable as the split number is increased. Therefore, such delay becomes a serious issue in the event that a high speed processing is requested.
Therefore, the present invention has been made in light of the above problems and it is an object of the present invention to provide a data split parallel shifter which is able to shorten a processing time necessary for a data split parallel shifting process including code extension.
It is another object of the present invention to provide a high speed adder/subtractor.
It is still another object of the present invention to provide an efficient carry-select type adder/subtractor.
In order to achieve the above objects, there is provided a data split parallel shifter comprising: a shifter for receiving to-be-shifted data and an amount of shift, and then shifting the to-be-shifted data according to the amount of shift; a code extension data generator for receiving the to-be-shifted data, split mode information, and arithmetic/logical shift information, and then generating code extension data corresponding to respective fields of the to-be-shifted data which is split based on the split mode information; a mask signal generator for generating a mask signal, which is used to select data shifted by the shifter and the code extension data alternatively bit by bit, based on the amount of shift and the split mode information; and an output selector for receiving the data shifted by the shifter, the code extension data, and the mask signal, then selecting the data shifted by the shifter and the code extension data alternatively for respective bits of the data shifted by the shifter based on the mask signal, and then outputting data which are shifted and code-extended according to the split mode information and the arithmetic/logical shift information.
In the preferred embodiment of the present invention, the shifter receives further leftward/rightward shifting information and then shifts the to-be-shifted data leftward or rightward based on the leftward/rightward shifting information, and the mask signal generator receives further the leftward/ rightward shifting information and then generates the mask signal further based on the leftward/rightward shifting information.
In the preferred embodiment of the present invention, the mask signal generator generates mask signals for minimum field which is decided based on all available split mode information, based on lower bit information in the amount of shift, the lower bit information having a number of digits by which a number of bits of the minimum field can be represented, and generates the mask signal by selecting overall masking of the minimum field, or masking of bits in the minimum field by the masking signal, or overall no-masking of the minimum field for each minimum field, based on upper bit information in the amount of shift, the upper bit information having a number of digits by which a number of the minimum field decided by a total number of bits of to-be-shifted data and a number of bits of the minimum field can be represented.
In order to achieve the above objects, there is provided a parallel adder comprising: a least significant unit adder for receiving a least significant portion of arithmetic data to execute an adding operation; at least a pair of unit adders, each unit adder of each pair of unit adders, receiving corresponding portion of the arithmetic data and split mode information to execute the adding operation; and at least one selector provided correspondingly to the at least a pair of unit adders, each of the at least one selector receiving results of respective adding operations from corresponding pair of unit adders and carry information supplied from lower digits, and then selecting one of the results of the respective adding operations according to the carry information to then output the selected one.
According to the present invention, if the split mode information indicates that the upper calculation is not independent from the lower calculation, a pair of unit adders output added results for the cases where the carry is supplied from lower digits and no carry is supplied from lower digits respectively. Therefore, at that time, the selector outputs alternatively one of the added results obtained when the carry is supplied from lower digits and no carry is supplied from lower digits, according to the carry supplied from lower digits. In contrast, if the split mode information indicates that the upper calculation is independent from the lower calculation, both a pair of unit adders output added results for the case where no carry is supplied from lower digits. Therefore, at that time, the selector outputs the added result obtained when no carry is supplied from lower digits, regardless of the carry supplied from lower digits. As a result, the adding process can be effected in parallel independently by the adders which are split into any number at any locations. According to such parallel adding processing device, since there is no necessity of adding an extra control circuit deciding whether or not the carry is passed over upper digits, the parallel adding process can be carried out at high speed.
In the preferred embodiment of the present invention, both unit adders of each pair of unit adders output a result of an adding operation for a case where no carry is supplied from lower digits when the split mode information indicates that the adding operation is independent of an adding operation in the least significant unit adder or a lower adjacent pair of unit adders.
In the preferred embodiment of the present invention, a number of the pair of unit adders is two or more.
In order to achieve the above objects, there is provided a parallel subtractor comprising: a least significant unit subtractor for receiving a least significant portion of arithmetic data to execute a subtracting operation; at least a pair of unit subtractors, each unit subtractor of each pair of unit subtractors, receiving corresponding portion of the arithmetic data and split mode information to execute the subtracting operation; and at least one selector provided correspondingly to the at least a pair of unit subtractors, each of the at least one selector receiving results of respective subtracting operations from corresponding pair of unit subtractors and carry information supplied from lower digits, and then selecting one of the results of the respective subtracting operations according to the carry information to then output the selected one.
According to the present invention, if the split mode information indicates that the upper calculation is not independent from the lower calculation, a pair of unit subtractors output subtracted results for the cases where the carry is supplied from lower digits and no carry is supplied from lower digits respectively. Therefore, at that time, the selector outputs alternatively one of the subtracted results obtained when the carry is supplied from lower digits and no carry is supplied from lower digits, according to the carry supplied from lower digits. In contrast, if the split mode information indicates that the upper calculation is independent from the lower calculation, both a pair of unit subtractors output subtracted results for the case where no carry is supplied from lower digits. Therefore, at that time, the selector outputs the subtracted result obtained when no carry is supplied from lower digits, regardless of the carry supplied from lower digits. As a result, the subtracting process can be effected in parallel independently by the subtractors which are split into any number at any locations. According to such parallel subtracting processing device, since there is no necessity of adding an extra control circuit deciding whether or not the carry is passed over upper digits, the parallel subtracting process can be carried out at high speed.
In the preferred embodiment of the present invention, both unit subtractors of each pair of unit subtractors output a result of a subtracting operation for a case where no carry is supplied from lower digits when the split mode information indicates that the subtracting operation is independent of a subtracting operation in the least significant unit subtractor or a lower adjacent pair of unit subtractors.
In the preferred embodiment of the present invention, a number of the pair of unit subtractors is two or more.
In order to achieve the above objects, there is provided a parallel adder/subtractor comprising: a least significant unit adder/subtractor for receiving a least significant portion of arithmetic data to execute an adding or subtracting operation; at least a pair of unit adders/subtractors, each unit adder/subtractor of each pair of unit adders/subtractors, receiving corresponding portion of the arithmetic data and split mode information to execute the adding or subtracting operation; and at least one selector provided correspondingly to the at least a pair of unit adders/subtractors, each of the at least one selector receiving results of respective adding or subtracting operations from corresponding pair of unit adders/subtractors and carry information supplied from lower digits, and then selecting one of the results of the respective adding or subtracting operations according to the carry information to then output the selected one.
According to the present invention, if the split mode information indicates that the upper calculation is not independent from the lower calculation, a pair of unit adders/subtractors output added or subtracted results for the cases where the carry is supplied from lower digits and no carry is supplied from lower digits respectively, according to addition/subtraction information. Therefore, at that time, the selector outputs alternatively one of the added or subtracted results obtained when where the carry is supplied from lower digits and no carry is supplied from lower digits, according to the carry supplied from lower digits. In contrast, if the split mode information indicates that the upper calculation is independent from the lower calculation, both a pair of unit adders/subtractors output added or subtracted results for the case where no carry is supplied from lower digits, according to addition/subtraction information. Therefore, at that time, the selector outputs the added or subtracted result obtained when no carry is supplied from lower digits, regardless of the carry supplied from lower digits. In addition, According to addition/subtraction information, the addition or the subtraction can be set arbitrarily onto respective portions split by the split mode information. As a result, the adding or subtracting process can be effected in parallel independently by the adders/subtractors which are split into any number at any locations. According to such parallel adding/subtracting processing device, since there is no necessity of adding an extra control circuit deciding whether or not the carry is passed over upper digits, the parallel adding/subtracting process can be carried out at high speed.
In the preferred embodiment of the present invention, both unit adders/subtractors of each pair of unit adders/subtractors output a result of an adding or subtracting operation for a case where no carry is supplied from lower digits when the split mode information indicates that the adding or subtracting operation is independent of an adding or subtracting operation in the least significant unit adder/subtractor or a lower adjacent pair of unit adders/subtractors.
In the preferred embodiment of the present invention, a number of the pair of unit adders/subtractors is two or more.
The nature, principle and utility of the invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings.